Introduce xc_core_arch_gpfn_may_present() hook.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 30 Aug 2007 14:00:21 +0000 (15:00 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 30 Aug 2007 14:00:21 +0000 (15:00 +0100)
On ia64 trying to map a foreign domain page which isn't allocated
cause annoying warning message. xm dump-core results in too many
warnings. With this hook, ia64 dump-core can suprress warning.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
tools/libxc/xc_core.c
tools/libxc/xc_core.h
tools/libxc/xc_core_ia64.c
tools/libxc/xc_core_ia64.h
tools/libxc/xc_core_powerpc.c
tools/libxc/xc_core_powerpc.h
tools/libxc/xc_core_x86.c
tools/libxc/xc_core_x86.h

index 9ddbfef418c26a80d96372d60bf5fdea872f288f..b4047308006d1a64a062b7ad3b37fc0179f18367 100644 (file)
@@ -474,8 +474,9 @@ xc_domain_dumpcore_via_callback(int xc_handle,
     }
 
     /* obtain memory map */
-    sts = xc_core_arch_memory_map_get(xc_handle, &info, live_shinfo,
-                                      &memory_map, &nr_memory_map);
+    sts = xc_core_arch_memory_map_get(xc_handle, &arch_ctxt, &info,
+                                      live_shinfo, &memory_map,
+                                      &nr_memory_map);
     if ( sts != 0 )
         goto out;
 
@@ -756,6 +757,9 @@ xc_domain_dumpcore_via_callback(int xc_handle,
             }
             else
             {
+                if ( !xc_core_arch_gpfn_may_present(&arch_ctxt, i) )
+                    continue;
+
                 gmfn = i;
                 pfn_array[j] = i;
             }
index 278be895ddd47ad8e2fcf66cc32673c0c36c4714..c15729e5afcc6950a24b189c066c268a73462c2c 100644 (file)
@@ -133,8 +133,10 @@ struct xc_core_memory_map {
 };
 typedef struct xc_core_memory_map xc_core_memory_map_t;
 int xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info);
-int xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info,
-                                shared_info_t *live_shinfo,
+struct xc_core_arch_context;
+int xc_core_arch_memory_map_get(int xc_handle,
+                                struct xc_core_arch_context *arch_ctxt,
+                                xc_dominfo_t *info, shared_info_t *live_shinfo,
                                 xc_core_memory_map_t **mapp,
                                 unsigned int *nr_entries);
 int xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info,
index 89c1053886fde99c39bfc29ad102a30775441800..e092d6f69fea9853cf277db3924978e5889d320d 100644 (file)
@@ -158,8 +158,8 @@ memory_map_get_old(int xc_handle, xc_dominfo_t *info,
 }
 
 int
-xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info,
-                            shared_info_t *live_shinfo,
+xc_core_arch_memory_map_get(int xc_handle, struct xc_core_arch_context *unused,
+                            xc_dominfo_t *info, shared_info_t *live_shinfo,
                             xc_core_memory_map_t **mapp,
                             unsigned int *nr_entries)
 {
index 6357dfa20eb9846f56a8aa547f5bf09b61ddedc4..03cd8e0182d3cf9531cca65a0286f1351d167fc0 100644 (file)
@@ -46,6 +46,7 @@ xc_core_arch_context_get_shdr(struct xc_core_arch_context* arch_ctxt,
 int
 xc_core_arch_context_dump(struct xc_core_arch_context* arch_ctxt,
                           void* args, dumpcore_rtn_t dump_rtn);
+#define xc_core_arch_gpfn_may_present(arch_ctxt, i)             (1)
 
 #endif /* XC_CORE_IA64_H */
 
index a29fdb83b33c330675f6e5a7908a87ff0a7c69a1..dd8f26b371b4bcba930a8f46b5c8a6be6b7ff956 100644 (file)
@@ -43,8 +43,8 @@ xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info,
 }
 
 int
-xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info,
-                            shared_info_t *live_shinfo,
+xc_core_arch_memory_map_get(int xc_handle, struct xc_core_arch_context *unused,
+                            xc_dominfo_t *info, shared_info_t *live_shinfo,
                             xc_core_memory_map_t **mapp,
                             unsigned int *nr_entries)
 {
index ce8aaf17c5aed58b40b3bb4cee72d2a447e1af04..2f39413c4dd6c656d6b4b4579d2d256b631f3773 100644 (file)
@@ -33,6 +33,7 @@ struct xc_core_arch_context {
 #define xc_core_arch_context_get(arch_ctxt, ctxt, xc_handle, domid) \
                                                                 (0)
 #define xc_core_arch_context_dump(arch_ctxt, args, dump_rtn)    (0)
+#define xc_core_arch_gpfn_may_present(arch_ctxt, i)             (1)
 
 static inline int
 xc_core_arch_context_get_shdr(struct xc_core_arch_context *arch_ctxt, 
index 3932f8e96b3815bb75a5d7c5456befb256ca628d..4aa825b87d88fcc85154516073ac98303da2810e 100644 (file)
@@ -33,8 +33,8 @@ xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info)
 }
 
 int
-xc_core_arch_memory_map_get(int xc_handle, xc_dominfo_t *info,
-                            shared_info_t *live_shinfo,
+xc_core_arch_memory_map_get(int xc_handle, struct xc_core_arch_context *unused,
+                            xc_dominfo_t *info, shared_info_t *live_shinfo,
                             xc_core_memory_map_t **mapp,
                             unsigned int *nr_entries)
 {
index 53ca48493d2c16e66ab52fd46d30886d353a0817..6e3490bb275cfc12c8e50dd031f713e2a5da304d 100644 (file)
@@ -40,6 +40,7 @@ struct xc_core_arch_context {
 #define xc_core_arch_context_get(arch_ctxt, ctxt, xc_handle, domid) \
                                                                 (0)
 #define xc_core_arch_context_dump(arch_ctxt, args, dump_rtn)    (0)
+#define xc_core_arch_gpfn_may_present(arch_ctxt, i)             (1)
 
 static inline int
 xc_core_arch_context_get_shdr(struct xc_core_arch_context *arch_ctxt,